package com.example.javalib.jihe;

import java.util.ArrayList;
import java.util.Random;

public class RandomTest {
    public static void main(String[] args) {
//        数字依次增长
//        每隔四个数，有一个4的倍数

        ArrayList<Integer> arrayList = new ArrayList<Integer>();
        Random rand = new Random();
        for (int i = 1; i <=100; i++) {

            int random= rand.nextInt(4)+1;
            if (i%4==0) {
                arrayList.add(i-random,i);
            }else {
                arrayList.add(i);
            }
        }

        for (int i = 0; i < arrayList.size(); i++) {
            if (i%4==0) {
                System.out.println();
            }
            System.out.print(arrayList.get(i)+"   ");
        }


    }
}
